<template>
	<view class="content">
		<view class="title">{{ title }}</view>
		<view class="time">{{ createTime }}</view>
		<view>{{ content }}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				articleId: '',
				title: '',
				createTime: '',
				content: '',
			}
		},
		methods: {
			onLoad: function (option) {
			    const id = option.id;
				this.articleId = id;
				this.getData();
			},
			getData() {
				let id = this.articleId;
				let token = getApp().globalData.token;
				uni.request({
					url: getApp().globalData.url + '/blade-visual/appindex/detail',
					header: {
						'blade-auth': "bearer " + token
					},
					method: "get",
					data: {
						id: id,
					},
					success: (res) => {
						// console.log(res);
						let code = res.data.code;
						if(code == 200) {
							let data = res.data.data;
							this.title = data.title
							this.createTime = data.createTime
							this.content = data.content
						} else {
							uni.showToast({
								title: res.data.msg,
								duration: 2000,
								icon: 'none'
							})
						}
					}
				});
			},
		}
	}
</script>

<style>
	.content {
		padding: 20rpx 30rpx 30rpx;
		width: 100%;
		line-height: 44rpx;
		background: #fff;
		color: #333;
	}
	
	.title {
		line-height: 64rpx;
		font-size: 36rpx;
		font-weight: 600;
	}
	
	.time {
		font-size: 24rpx;
		color: #999999;
	}
</style>
